package com.sunlands.zlcx.usercenter.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author shixiaopeng
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "tz_vip_user_use_record")
@DynamicUpdate
@DynamicInsert
public class VipUserUseRecordDO implements Serializable {

    private static final long serialVersionUID = -1210975848079627189L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 用户表tz_user的id
     */
    private Long userId;

    /**
     * 过期日期
     */
    private Date expireDate;
    /**
     *当月使用时长
     */
    private Long useredTime;

    /**
     * 当月总时长
     */
    private Long totalTime;

    /**
     * @see VipUserDO.LevelEnum
     * VIP用户等级
     */
    private Integer level;

    private Long setMealId;

    private Long setMealRecordId;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(insertable = false, updatable = false)
    Date updateTime;

    @ApiModelProperty(value ="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(insertable = false, updatable = false)
    Date createTime;
}
